package com.wyw.springcloud.config;

import com.netflix.loadbalancer.IRule;
import com.wyw.springcloud.rules.ConsistentRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 文件介绍
 *
 * @Author： Mr Wu （yewen.wu.china.gmail.com）
 * @Date: 2020/9/24 15:58
 */
@Configuration
//@RibbonClient(name = "eureka-client", configuration = com.netflix.loadbalancer.RoundRobinRule.class)
public class RibbonConfiguration {

    /**
     * 声明RandomRule策略
     * @return
     */
//    @Bean
//    public IRule defaultLBStrategy(){
//        return new RandomRule();
//    }

    @Bean
    public IRule ConsistentRule(){
        return new ConsistentRule();
    }
}
